{% extends "base.html" %}

{% load i18n %}

{% block title %}{% trans "Home" %}{% endblock %}

{% block custom_styles %}
<style type="text/css">
#tagCloud {
  text-align:center; 
  padding:5px;
  overflow:auto; 
  font-size:70%; 
  font-family:Tahoma;
}
#tagList { 
	margin:0; 
	padding:0; 
}
#tagList li {
  list-style-type:none; 
  float:{% if LANGUAGE_BIDI %}right{% else %}left{% endif %}; 
  margin:0 10px; 
  height:35px;
}
#tagList li a { 
	text-decoration:none; 
	color:#777; 
}
#tagList li a:hover { 
	text-decoration:underline; 
}

#mainSearchTextbox {
width: 250px;
height: 30px;
font-family: Tahoma;
font-size: 16px;
text-align: {% if LANGUAGE_BIDI %}right{% else %}left{% endif %};
direction: {% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %};
}
</style>
{% endblock custom_styles %}

{% block content %}
<div id="ads_featured" class="span-8 last">
<h3 class="loud">{% trans "Featured Ad" %}</h3>
<hr/>
{% if ad %}
{% include "ad/ad_box.html" %}
{% endif %}

<div>
<a href="/ads/explore/">{% trans "Explore Ads" %}</a>
<br/>
<a href="/ads/explore/popular/">{% trans "Most Popular Ads" %}</a>
<br/>
<a href="/ads/explore/views/">{% trans "Most Viewed Ads" %}</a>
</div>
</div>

<div class="span-1">&nbsp;</div>
<div id="ads_search" class="span-7">
<h3 class="loud">{% trans "Search" %}</h3>
<hr/>
<form action="/ads/search/" method="post">{% csrf_token %}
<p>
<input type="text" name="query" value="" id="mainSearchTextbox" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}"/>
</p>
<p>
<input type="submit" value='{% trans "Search" %}'/>
</p>
</form>
<div>
<a href="/ads/explore/day/">{% trans "Today Ads" %}</a>
<br/>
<a href="/ads/explore/week/">{% trans "Week Ads" %}</a>
<br/>
<a href="/ads/explore/month/">{% trans "Month Ads" %}</a>
<br/>
<a href="/ads/explore/year/">{% trans "Year Ads" %}</a>
</div>
</div>

<div class="span-1">&nbsp;</div>
<div id="ads_tag_cloud" class="span-7 last">
<h3 class="loud">{% trans "Popular Tags" %}</h3>
<hr/>
<div id="tagCloud" class="span-7">
<ul id="tagList">
{% for t in tags %}
<li>
<a href="/ads/tag/explore/{{ t.id }}/" title="{{ t.frequency }}">{{ t.term }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="span-24 last">
{% trans "Total Registered Ads" %}: {{ total_registered_ads }}
</div>
<div class="span-24 last">
{% trans "Total Published Ads" %}: {{ total_published_ads }}
</div>
<div class="span-24 last">
{% trans "Total Views" %}: {{ total_ad_views }}
</div>
<div class="span-24 last">
{% trans "Top Investor Advertizer" %}: 
<a href="/ads/explore/advertizer/{{ top_investor.id }}/">{{ top_investor }}</a> ({{ top_investor_total }})
<br/>
{% trans "Top Registrar Advertizer" %}: 
<a href="/ads/explore/advertizer/{{ top_registrar.id }}/">{{ top_registrar }}</a> ({{ top_registrar_total }})
</div>
<div class="span-24 last">
<a href="/rss/ads/latest/">RSS</a>
</div>

{% endblock content %}